package db;

import db.SQLDataTypes;

public class TableField
{
	private String fieldName;
	private SQLDataTypes dataType;
	private String properties;
	
	/**
	 * TableField encapsulates creation of an SQL database table<br>
	 * Example: TableField("firstname","VARCHAR(30)");<br>
	 * @param fieldName - name of the field
	 * @param fieldProps - string of field properties
	 */
	public TableField(String fieldName, SQLDataTypes dataType)
	{
		this.fieldName = fieldName;
		this.dataType = dataType;
	}
	
	public TableField(String fieldName, String properties)
	{
		this.fieldName = fieldName;
		this.properties = properties;
	}

	/**
	 * 
	 * @return TableField's field name
	 */
	public String getFieldName()
	{
		return fieldName;
	}

	/**
	 * set the field name
	 * @param fieldName
	 */
	public void setFieldName(String fieldName)
	{
		this.fieldName = fieldName;
	}

	/**
	 * 
	 * @return - SQLDataType, the type of data that defines this field
	 */
	public SQLDataTypes getDataType()
	{
		return dataType;
	}

	/**
	 * Set the type of data that defines this field
	 * @param dataType - SQLDataType, the type of data
	 */
	public void setDataType(SQLDataTypes dataType)
	{
		this.dataType = dataType;
	}
	
	/**
	 * If the TableField was defined using a string of properties, use this
	 * @return String, a string of properties
	 */
	public String getProps()
	{
		return properties;
	}

	
	
}
